using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demo01
{
    class UserInfo
    {
        string Name;
        int Age;
        char Sex;

        public string UserName 
        {
            get { return this.Name; }
            set { Name = value; }
        }

        public int UserAge 
        {
            get { return this.Age; }
            set {
                if (value > 0 || value < 150)
                {
                    Age = value; 
                }
                else
                {
                    Console.WriteLine("输入错误!");
                }
                }
        }

        public char UserSex 
        {
            get { return this.Sex; }
            set {
                if (value == '男'|| value == '女')
                {
                    Sex = value;
                }
                else
                {
                    Console.WriteLine("输入错误！");
                }
                }
        }

        public void SayHi()
        {
            Console.WriteLine("我的名字是{0}，我{1}岁，我是{2}的",this.Name,this.Age,this.Sex);
        }

        string preName;
        string preAddress;
        string preCharge;

        public string PreName 
        {
            get { return this.preName; }
            set { preName = value; } 
        }

        public string PreAddress 
        {
            get { return this.preAddress; }
            set { preAddress = value; } 
        }

        public string PreCharge 
        {
            get { return this.preCharge; }
            set { preCharge = value; }
        }

        public void SayPre()
        {
            Console.WriteLine("出版社名字是{0}，地址为{1}，负责人为{2}", this.preName, this.preAddress, this.preCharge);
        }

        int bookISBN;
        string bookName;
        int bookMoney;

        public int BookISBN
        {
            get { return this.bookISBN; }
            set { bookISBN = value; } 
        }

        public string BookName 
        {
            get { return this.bookName; } 
            set { bookName = value; }
        }

        public int BookMoney 
        {
            get { return this.bookMoney; }
            set { bookMoney = value; }
        }

        public void SayBook()
        {
            Console.WriteLine("图书ISBN码为{0}，书名{1}，价格为{2}", this.bookISBN, this.bookName, this.bookMoney);
        }
    }
}